function rand(low, high )
{	
	return low  +  Math.random() * ( high - low );
}

var frameNum = 0;

function InitData( )
{
	ColorArray = new Float32Array( NUMPARTICLES * 3 );
	
	XYZArray = new Float32Array( NUMPARTICLES * 4 );
	
	XVelArray = new Float32Array( NUMPARTICLES );
	ZVelArray = new Float32Array( NUMPARTICLES );
	AccelArray = new Float32Array( NUMPARTICLES );
	DecelArray = new Float32Array( NUMPARTICLES );
	
	RandomArray = new Float32Array( NUMPARTICLES );
	
	for(var i = 0; i < particles.length; i++ )
	{
		var obj = {			
			'x' : 0,
			'y' : 0,
			'z' : 0,
			
			'vx' : 0,
			'vz' : 0,
						
			'Accel' : 0,
			'Decel' : 0,
			'Dir' : 0,
			
			'ScaleP' : rand(0,2) + 1,
			
			'r' : 1,
			'g' : 1,
			'b' : 1
		}
		particles[i]=obj;
		RandomArray[i] = i;
		genParticle(i, true);
		//console.log(i+": "+particles[i].Accel+" "+particles[i].Decel);
		
		XYZArray[i*4] = particles[i].x;
		XYZArray[i*4 + 1] = particles[i].y;
		XYZArray[i*4 + 2] = particles[i].z;
		XYZArray[i*4 + 3] = 1.0;
		
		XVelArray[i] = particles[i].vx;
		ZVelArray[i] = particles[i].vz;
		AccelArray[i] = particles[i].Accel;
		DecelArray[i] = particles[i].Decel;
		
		ColorArray[i*3] = particles[i].r;
		ColorArray[i*3+1] = particles[i].g;
		ColorArray[i*3+2] = particles[i].b;
	}
}
